<%@ include file="database_ini.jsp"%>
<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="org.json.*"%>
<%
  	System.out.println("started:.....");
    	
    	String sql =null;
    	ResultSet rs =null;
    	String Serailkey = request.getParameter("Serailkey");
    	/*********debug*/
    	System.out.println(Serailkey);
    	/**********/
    	int Serailkey_Int = Integer.parseInt(Serailkey);
    	
    	JSONObject obj=new JSONObject();

  		
    	
    	sql = "SELECT CCParameterName, StorerkeyFrom, StorerkeyTo , SkuFrom, SkuTo, ClassFrom, ClassTo, ZoneFrom, ZoneTo, LocFrom, LocTo, XCOORDFROM, XCOORDTO, YCOORDFROM, YCOORDTO, ZCOORDFROM, ZCOORDTO, DisplaySystemCount " 
    	+ " FROM CCParameter where Serailkey = ?";
    	
    	pstmt = conn.prepareStatement(sql);
    	pstmt.setInt(1 , Serailkey_Int);
    	
    	rs = pstmt.executeQuery();
    	while (rs.next()) {
    		String CCParameterName = rs.getString("CCParameterName");
	  		String StorerkeyFrom = rs.getString("StorerkeyFrom");
	  		String StorerkeyTo = rs.getString("StorerkeyTo");
	  		String SkuFrom = rs.getString("SkuFrom");
	  		String SkuTo = rs.getString("SkuTo");
	  		String ClassFrom = rs.getString("ClassFrom");
	  		String ClassTo = rs.getString("ClassTo");
	  		String ZoneFrom = rs.getString("ZoneFrom");
	  		String ZoneTo = rs.getString("ZoneTo");
	  		String LocFrom = rs.getString("LocFrom");
	  		String LocTo = rs.getString("LocTo");
	  		String XCOORDFROM = rs.getString("XCOORDFROM");
	  		String XCOORDTO = rs.getString("XCOORDTO");
	  		String YCOORDFROM = rs.getString("YCOORDFROM");
	  		String YCOORDTO = rs.getString("YCOORDTO");
	  		String ZCOORDFROM = rs.getString("ZCOORDFROM");
	  		String ZCOORDTO = rs.getString("ZCOORDTO");
	  		String DisplaySystemCount = rs.getString("DisplaySystemCount");

	    		
	   		
	   		/****************/
	   		
	   		System.out.println("CCParameterName:" + CCParameterName);
	   		System.out.println("StorerkeyFrom:" + StorerkeyFrom);
	  		System.out.println("StorerkeyTo:" + StorerkeyTo);
	  		System.out.println("SkuFrom:" + SkuFrom);
	  		System.out.println("SkuTo:" + SkuTo);
	  		System.out.println("ClassFrom:" + ClassFrom);
	  		System.out.println("ClassTo:" + ClassTo);
	  		System.out.println("ZoneFrom:" + ZoneFrom);
	  		System.out.println("ZoneTo:" + ZoneTo);
	  		System.out.println("LocFrom:" + LocFrom);
	  		System.out.println("LocTo:" + LocTo);
	  		System.out.println("XCOORDFROM:" + XCOORDFROM);
	  		System.out.println("XCOORDTO:" + XCOORDTO);
	  		System.out.println("YCOORDFROM:" + YCOORDFROM);
	  		System.out.println("YCOORDTO:" + YCOORDTO);
	  		System.out.println("ZCOORDFROM:" + ZCOORDFROM);
	  		System.out.println("ZCOORDTO:" + ZCOORDTO);
	  		System.out.println("DisplaySystemCount:" + DisplaySystemCount);
	
	   		/****************/
	   		
	   		JSONObject child = new JSONObject();
	   		
			obj.put("CCParameterName", CCParameterName);
			obj.put("StorerkeyFrom", StorerkeyFrom);
			obj.put("StorerkeyTo", StorerkeyTo);
			obj.put("SkuFrom", SkuFrom);
			obj.put("SkuTo", SkuTo);
			obj.put("ClassFrom", ClassFrom);
			obj.put("ClassTo", ClassTo);
			obj.put("ZoneFrom", ZoneFrom);
			obj.put("ZoneTo", ZoneTo);
			obj.put("LocFrom", LocFrom);
			obj.put("LocTo", LocTo);
			obj.put("XCOORDFROM", XCOORDFROM);
			obj.put("XCOORDTO", XCOORDTO);
			obj.put("YCOORDFROM", YCOORDFROM);
			obj.put("YCOORDTO", YCOORDTO);
			obj.put("ZCOORDFROM", ZCOORDFROM);
			obj.put("ZCOORDTO", ZCOORDTO);
			obj.put("DisplaySystemCount", DisplaySystemCount);
	
	  		

  	}

  	
  	/****************/

  	/****************
  	obj.put("name","foo");
  	obj.put("num",new Integer(100));
  	obj.put("balance",new Double(1000.21));
  	obj.put("is_vip",new Boolean(true));
  	/****************/

  	out.print(obj);
  	System.out.println(obj);
  	out.flush();

  	conn.close();
  %>